<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

// 正则限制
// Route::get('test/{name}',function($name){
// 	echo $name;
// })->where('name','[a-z]+');

//携带参数
// Route::get('t/{name}','TestController@say');

//隐试路由
// Route::controller('asd','TestController');

// 后台-------------------------------------------------------------------------------------------------------------------
Route::group(['middleware' => 'user'], function () {

	//后台主页
    Route::resource('admins','admin\AdminController');

	//访问角色管理页面
	Route::resource('user','admin\UserController');

	//管理员删除操作
	Route::get('del/{id}','admin\UserController@del');

	//分类模块
	Route::resource('cate','admin\CateController');

	//删除分类
	Route::get('/cate_del/{id}','admin\CateController@cate_del');

	//文章分类
	Route::resource('article','admin\ArticleController');

	//删除文章
	Route::get('/art_del/{id}','admin\ArticleController@destroy');
});

//后台登录
Route::resource('login','admin\LoginController');




//前台----------------------------------------------------------------------------------------------------------------------
//前台主页
Route::resource('home','home\IndexController');

//注册----------
Route::resource('register','home\RegisterController');

//生成验证码
Route::get('code','home\RegisterController@code');

//激活邮件
Route::get('activation','home\RegisterController@activation');

//登录----------
Route::resource('login','home\LoginController');

//导航栏
Route::resource('column','home\ColumnController');






